#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>

/*//回收进程
int main(int argc, char* argv[])
{

	pid_t pid;
	int status;

	pid = fork();	//创建子进程
	if(pid < 0)
	{
		perror("fork");
		exit(-1);
	}else if(pid == 0)
	{
		printf("child 回收\n");
		exit(2);
	}else
	{
		wait(&status);
		printf("wait = %d", WEXITSTATUS(status));
	}
	while(1)
	{
     sleep(1);
    }
}*/

//============================================

int main(int argc, char* argv[])
{

	int status;
	pid_t pid;
	pid = fork();
	if(pid < 0)
	{
		perror("fork");
	}else if(pid == 0)
	{
		printf("child\n");
		exit(0);
	}else if(pid>0)
	{
		//wait(status);
	}
	while(1)
	{
		;
	}
}





















